#!/bin/sh

GLASSFISH_HOME="/Applications/NetBeans/glassfish"
DEBUG="--debug"

asadmin="${GLASSFISH_HOME}/bin/asadmin"
trap 'echo "Stopping glassfish"; "$asadmin" stop-domain; exit 0' INT TERM 

"$asadmin" start-domain --verbose "${DEBUG}"